Add compatibility shim for g_memdup2()
authorEmmanuele Bassi <ebassi@gnome.org>
Thu, 4 Feb 2021 19:27:22 +0000 (19:27 +0000)
committerEmmanuele Bassi <ebassi@gnome.org>
Thu, 11 Feb 2021 12:57:38 +0000 (12:57 +0000)
We don't necessarily want to depend on a newer version of GLib, given
that we're not really using g_memdup() in the wrong way.

gdk/gdk-private.h

index 3df7d3215c3756842de4090627f8ff43c723b18b..fb3c18cd6f43ccf9b61394aa8e70ee9e22ef0080 100644 (file)
@@ -49,4 +49,12 @@ guint gdk_parse_debug_var (const char        *variable,
                            const GdkDebugKey *keys,
                            guint              nkeys);
 
+/* Backward compatibility shim, to avoid bumping up the minimum
+ * required version of GLib; most of our uses of g_memdup() are
+ * safe, and those that aren't have been fixed
+ */
+#if !GLIB_CHECK_VERSION (2, 67, 3)
+# define g_memdup2(mem,size)    g_memdup((mem),(size))
+#endif
+
 #endif /* __GDK__PRIVATE_H__ */